package com.xiaobao.service.impl;

import com.xiaobao.mapper.SchoolMapper;
import com.xiaobao.pojo.School;
import com.xiaobao.service.SchoolService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

//考研学校合集
@Service
public class SchoolServiceImpl implements SchoolService {
    private final SchoolMapper schoolMapper;

    public SchoolServiceImpl(SchoolMapper schoolMapper) {
        this.schoolMapper = schoolMapper;
    }

    /**
     * 获取考研学校合集
     * 此方法用于获取系统中所有考研学校的列表它利用 MyBatis 框架的
     * schoolMapper 接口中的 getAllSchools 方法来查询数据库中的学校信息
     *
     * @return School[] 返回一个 School 对象数组，包含所有考研学校的实例
     */
    @Override
    //@Transactional
    public School[] getAllSchools() {
        return schoolMapper.getAllSchools();
    }

}
